Skip to content

feat: Integrate SubscriptionController into wallet initialization#9598

Open
tuna1207 wants to merge 7 commits into
mainfrom
feat/subscription-controller-mm-wallet
Open

feat: Integrate SubscriptionController into wallet initialization#9598
tuna1207 wants to merge 7 commits into
mainfrom
feat/subscription-controller-mm-wallet

Conversation

@tuna1207

@tuna1207 tuna1207 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Explanation

Adds SubscriptionController as a default initialized unit in @metamask/wallet, with injectable or default SubscriptionService construction and AuthenticationController messenger delegation.

@metamask/wallet is the shared controller-integration layer for extension, mobile, and other clients. Build-specific and runtime values are injected via instanceOptions rather than hardcoded.

Breaking changes

  • BREAKING: instanceOptions.subscriptionController is now required with at least env and fetchFunction.
  • When passing a full subscriptionService override, env and fetchFunction remain required at the type level but are unused for service construction.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

High Risk
Breaking change for all @metamask/wallet consumers (new required instanceOptions) and subscription flows depend on correct AuthenticationController registration for authenticated API calls.

Overview
BREAKING: @metamask/wallet now initializes SubscriptionController by default and requires a new instanceOptions.subscriptionController slot (env, fetchFunction, plus optional service/token/polling overrides). The package adds @metamask/subscription-controller, wires messenger delegation to AuthenticationController for bearer tokens, and re-exports SubscriptionEnv from the wallet entrypoint.

Wallet-cli’s daemon factory passes production env and globalThis.fetch for that slot (no AuthenticationController on the CLI root messenger, so authenticated subscription calls still need host wiring). Tests, changelogs, CODEOWNERS, and README dependency graph are updated accordingly.

Reviewed by Cursor Bugbot for commit 01320db. Bugbot is set up for automated code reviews on this repo. Configure here.

@tuna1207
tuna1207 marked this pull request as ready for review July 23, 2026 00:58
@tuna1207
tuna1207 requested review from a team as code owners July 23, 2026 00:58
@tuna1207
tuna1207 temporarily deployed to default-branch July 23, 2026 00:58 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants